import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { ExpenseService } from './expense.service';
import { CreateDto } from './dto/create.dto'
import { GetExpensesDto } from './dto/get-expense.dto'
import { RemoveDto } from './dto/remove.dto'
import { UpdateDto } from './dto/update.dto'

@Controller('expenses')
export class ExpenseController {
  constructor(private readonly expenseService: ExpenseService) { }

  @Post("createExpense")
  async createExpense(@Body() createDto: CreateDto) {
    return this.expenseService.createExpense(createDto);
  }

  @Get("getExpensesByBillId")
  async getExpensesByBillId(@Query() getExpensesDto: GetExpensesDto) {
    return this.expenseService.getExpensesByBillId(getExpensesDto);
  }

  @Post("updateExpenseByDataId")
  async updateExpenseByDataId(@Body() updateDto: UpdateDto) {
    return this.expenseService.updateExpenseByDataId(updateDto);
  }

  @Post("removeExpensesByDataIds")
  async removeExpensesByDataIds(@Body() removeDto: RemoveDto) {
    return this.expenseService.removeExpensesByDataIds(removeDto);
  }

}